import PosterEditor, { IPosterEditorOptions } from "./editor";
import { IPosterTemplate, templateParser } from "./parser";

export default class Poster {
  constructor(private _template: IPosterTemplate) {}

  toDataUrl() {
    return templateParser(this._template);
  }

  toEditor(root: string | HTMLElement, options?: IPosterEditorOptions) {
    return new PosterEditor(root, this._template, options);
  }
}
